package com.example.yk_lx.addFriend;

import androidx.lifecycle.MutableLiveData;

import com.example.yk_lx.baseMVVM.BaseRepo;
import com.hyphenate.EMCallBack;

public class AddFriRepo extends BaseRepo {

    public void addFri(String name, String reason, MutableLiveData<String> success,MutableLiveData<String> fail){
        client.contactManager().aysncAddContact(name, reason, new EMCallBack() {
            @Override
            public void onSuccess() {
                success.postValue("添加好友成功");
            }

            @Override
            public void onError(int code, String error) {
                fail.postValue("添加好友失败："+error);
            }
        });
    }
}
